package com.lyl.springcloud.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author lylbell
 * @date 2021-05-31 17:35
 */
@RestController
@RefreshScope
public class ConfigClientController {

    //远程仓库上的yml配置（springcloud-config）
    @Value("${config.info}")
    private String configInfo;

    @Value("${server.port}")
    private String serverPort;

    @GetMapping("/configInfo")
    public String configInfo() {
        return "端口号" + this.serverPort + "。dev内容：" +this.configInfo;
    }
}
